<template>
  <div id="app">
    <div class="headerStyle">
        <img  src="./assets/images/logo.png" class="logoStyle"/>
        <div  class="bannerStyle">
            <img  src="./assets/images/admin.png" alt="" class="personImg">
            <div  class="persontext">
                <span  class="personName el-dropdown-link">管理员</span>
                <span  class="version">version: 1.0.0</span>
            </div>
        </div>
    </div>
    <div class="contain">
      <div class="contain-left" :style="leftStyle">
          <div class="contain-left-title">
              <span>工作流系统</span>
          </div>
          <ul class="nav-menu"  :style="menuStyle">
              <li class="menuItem is-active">
                  <div class="itemContain">
                      <i class="iconfont icon-homePage"></i>
                      <span>首页</span>
                  </div>
              </li>
              <li class="menuItem">
                  <div class="itemContain">
                      <i class="iconfont icon-homePage"></i>
                      <span><router-link to="/editor">编辑器</router-link></span>
                  </div>
              </li>
              <li class="menuItem">
                  <div class="itemContain">
                      <i class="iconfont icon-homePage"></i>
                      <span><router-link to="/List">菜单一</router-link></span>
                  </div>
              </li>
              <li class="menuItem">
                  <div class="itemContain">
                      <i class="iconfont icon-homePage"></i>
                      <span>菜单3</span>
                  </div>
              </li>
              <li class="menuItem">
                  <div class="itemContain">
                      <i class="iconfont icon-homePage"></i>
                      <span>菜单4</span>
                  </div>
              </li>
              <li class="menuItem">
                  <div class="itemContain">
                      <i class="iconfont icon-homePage"></i>
                      <span>菜单5</span>
                  </div>
              </li>
          </ul>
      </div>
      <div class="contain-right" :style="rightStyle">
        <router-view/>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
      return {
          leftStyle:{
              height:'800px'
          },
          rightStyle:{
              height:'800px'
          },
          menuStyle:{
              height:'700px'
          }
      }
  },
  methods:{
      resizeHeight() {
        var height = document.documentElement.clientHeight;

        // eslint-disable-next-line
        console.log(height);
        
        var h = height - 80;

        this.leftStyle.height = h + "px";
        this.rightStyle.height = h + "px";
        this.menuStyle.height = (h - 100) + "px";

      }
  },
  mounted() {
    var self = this;
    // 获取窗口高度
    self.resizeHeight();

    window.onresize = function(){
        self.resizeHeight();
    }
  }
};
</script>
<style>
@import 'styles/common.css';
@import 'styles/iconfont.css';

#app {
    font-family:'microsoft yahei',Avenir, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    font-size: 12px;
    width: 100%;
    height: 100%;
    background: url('assets/images/bg.png') no-repeat 0 0!important;
    background-size: cover;
    /* background-color:#b4c7d0; */
}

#app, * {
    padding: 0;
    margin: 0
}


.headerStyle {
    position: relative;
    height: 50px;
    line-height: 50px;
    width: 100%;
    display: inline-block
}

.headerStyle .logoStyle {
    height: 35px;
    width: 35px;
    position: absolute;
    left: 80px;
    bottom: 5px
}

.headerStyle .bannerStyle {
    width: calc(100% - 370px);
    position: absolute;
    right: 90px;
    color: #fff;
    text-align: right
}

.headerStyle .bannerStyle .downloadfile {
    display: inline-block;
    margin-bottom: 20px;
    margin-right: 30px;
    vertical-align: middle;
    margin-left: 10px;
    height: 60px
}

.headerStyle .bannerStyle .downloadfile a {
    text-decoration: none;
    color: #fff
}

.headerStyle .bannerStyle .personImg {
    width: 35px;
    height: 35px;
    margin-top: 10px;
    border-radius: 50%
}

.headerStyle .bannerStyle .persontext {
    display: inline-block;
    margin-bottom: 20px;
    vertical-align: middle;
    margin-left: 10px;
    height: 60px
}

.headerStyle .bannerStyle .personName {
    border: none;
    color: #fff;
    margin-right: 40px;
    margin-bottom: 40px
}

.headerStyle .bannerStyle .version {
    margin-left: 20px;
    margin-bottom: 40px
}

.headerStyle .bannerStyle .version a:hover {
    cursor: pointer
}


.contain {
    margin: 0 20px;
    position: relative;
}

.contain::after{
    content:'';
    display: block;
    clear: both;
    float: none;
}

.contain .contain-left {
    height:648px;
    width:200px;
    border-bottom-left-radius: 15px;
}

.contain .contain-left .contain-left-title {
    background: url(assets/images/nav_bg.gif);
    background-size: cover;
    width: 200px;
    height: 100px;
    margin-left: 5px;
    position: relative
}

.contain .contain-left .contain-left-title span {
    position: absolute;
    top: 50%;
    height: 20px;
    margin-top: -10px;
    left: 20px;
    color: #1c95fe;
    font-size: 18px;
    font-weight: 700
}

.contain .contain-right {
    position: absolute;
    left:200px;
    top:0px;
    right:0px;
    height:648px;
    overflow: hidden;
    background: #f1f3f8;
    border-top-right-radius: 15px;
    border-bottom-right-radius: 15px;
    padding: 0;
    margin: 0;
}

.contain .contain-left .nav-menu{
    border-right: 1px solid #e6e6e6;
    list-style: none;
    position: relative;
    margin-left: 5px;
    padding-left: 0;
    height: 548px;
    border-bottom-left-radius: 15px;
    background: #fff!important; /*只能在ul这里设置背景色，在上层div中设置则会显示margin负值部分*/
}

.contain .contain-left .menuItem {
    margin-bottom: 1px;
    height: 35px;
    line-height: 35px;
    text-align: left;
    position:relative;
}

.contain .contain-left .menuItem .itemContain {
    /* background: #fff; */  /*这里设置颜色后，会挡住上面li的阴影*/
    color: #516379;
    padding-left: 10px;
}

.contain .contain-left .menuItem.is-active .itemContain, 
.contain .contain-left .menuItem .itemContain:hover {
    background-image: url();
    box-shadow: 0 1px 3px 1px #a7a7ff;
    margin-left:-5px;
    padding-left:15px;
}

.contain .contain-left .menuItem .itemContain:hover,
.contain .contain-left .menuItem.is-active .itemContain {
    color: #fff
}
</style>
